This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
I have two date fields and a radio button group on my Xpage. If a value is selected from the radio button group, which is not a required field, the values of the two date fields should be the same. I added a validateExpression to the radio button group to check that this was the case. Here's my expression...
var from = getComponent("dateFrom").getValue();
var to = getComponent("dateTo").getValue();
if (value == "AM" | value == "PM") {
return from==to
}
This works when the user selects a value from the radio button group and the dateFrom and dateTo are different. I get my friendly custom error. However, if I subsequently make my dates the same the error is still thrown. I've tried using getSubmittedValue, but that's null. Has anyone got any ideas? My source code is below so that you can have a go.
<xp:this.beforePageLoad><![CDATA[#{javascript://add the name to the session scope
var userName:NotesName = session.createName(@UserName());
sessionScope.name = (userName.getCommon());
//add the logname to the session scope
var userName:NotesName = session.createName(@UserName());
var nab = new Array("Callisto/TFI","names.nsf");
var shortName = @DbLookup(nab,"($Users)",userName.getCommon(),"ShortName");
sessionScope.logname = shortName;}]]></xp:this.beforePageLoad>
<xp:this.validators>
<xp:validateDateTimeRange
message="Please select a date that's after your from date.">
<xp:this.minimum><![CDATA[#{javascript:var fromDate = getComponent("dateFrom");
var value = fromDate.getSubmittedValue();
if( value == null ){
// else not yet submitted
value = fromDate.getValue();
}}]]></xp:this.minimum>
</xp:validateDateTimeRange>
</xp:this.validators>
<xp:dateTimeHelper id="dateTimeHelper2"></xp:dateTimeHelper>
<xp:this.validators>
<xp:validateRequired
message="Please enter an end time">
</xp:validateRequired>
</xp:this.validators>
<xp:dateTimeHelper id="dateTimeHelper4"></xp:dateTimeHelper>